'Tokenizer': (('basic_header_tokenize', _('Basic header tokenising'), False, _('If true, tokenizer.Tokenizer.tokenize_headers() will tokenize the\n contents of each header field just like the text of the message\n body, using the name of the header as a tag. Tokens look like\n "header:word". The basic approach is simple and effective, but also\n very sensitive to biases in the ham and spam collections. For\n example, if the ham and spam were collected at different times,\n several headers with date/time information will become the best\n discriminators. (Not just Date, but Received and X-From_.)'), BOOLEAN, RESTORE), ('basic_header_tokenize_only', _('Only basic header tokenising'), False, _('If true and basic_header_tokenize is also true, then\n basic_header_tokenize is the only action performed.'), BOOLEAN, RESTORE), ('basic_header_skip', _('Basic headers to skip'), ('received date x-.*',), _('If basic_header_tokenize is true, then basic_header_skip is a set\n of headers that should be skipped.'), HEADER_NAME, RESTORE), ('check_octets', _('Check application/octet-stream sections'), False, _("If true, the first few characters of application/octet-stream\n sections are used, undecoded. What 'few' means is decided by\n octet_prefix_size."), BOOLEAN, RESTORE), ('octet_prefix_size', _('Number of characters of octet stream to process'), 5, _('The number of characters of the application/octet-stream sections\n to use, if check_octets is set to true.'), INTEGER, RESTORE), ('count_all_header_lines', _('Count all header lines'), False, _('Generate tokens just counting the number of instances of each kind\n of header line, in a case-sensitive way.\n\n Depending on data collection, some headers are not safe to count.\n For example, if ham is collected from a mailing list but spam from\n your regular inbox traffic, the presence of a header like List-Info\n will be a very strong ham clue, but a bogus one. In that case, set\n count_all_header_lines to False, and adjust safe_headers instead.'), BOOLEAN, RESTORE), ('record_header_absence', _('Record header absence'), False, _('When True, generate a "noheader:HEADERNAME" token for each header\n in safe_headers (below) that *doesn\'t* appear in the headers. This\n helped in various of Tim\'s python.org tests, but appeared to hurt a\n little in Anthony Baxter\'s tests.'), BOOLEAN, RESTORE), ('safe_headers', _('Safe headers'), ('abuse-reports-to', 'date', 'errors-to', 'from', 'importance', 'in-reply-to', 'message-id', 'mime-version', 'organization', 'received', 'reply-to', 'return-path', 'subject', 'to', 'user-agent', 'x-abuse-info', 'x-complaints-to', 'x-face'), _('Like count_all_header_lines, but restricted to headers in this list.\n safe_headers is ignored when count_all_header_lines is true, unless\n record_header_absence is also true.'), HEADER_NAME, RESTORE), ('mine_received_headers', _('Mine the received headers'), False, _('A lot of clues can be gotten from IP addresses and names in\n Received: headers. This can give spectacular results for bogus\n reasons if your corpora are from different sources.'), BOOLEAN, RESTORE), ('address_headers', _('Address headers to mine'), ('from', 'to', 'cc', 'sender', 'reply-to'), _("Mine the following address headers. If you have mixed source\n corpuses (as opposed to a mixed sauce walrus, which is delicious!)\n then you probably don't want to use 'to' or 'cc') Address headers will\n be decoded, and will generate charset tokens as well as the real\n address. Others to consider: to, cc, reply-to, errors-to, sender,\n ..."), HEADER_NAME, RESTORE), ('generate_long_skips', _('Generate long skips'), True, _("If legitimate mail contains things that look like text to the\n tokenizer and turning turning off this option helps (perhaps binary\n attachments get 'defanged' by something upstream from this operation\n and thus look like text), this may help, and should be an alert that\n perhaps the tokenizer is broken."), BOOLEAN, RESTORE), ('summarize_email_prefixes', _('Summarise email prefixes'), False, _('Try to capitalize on mail sent to multiple similar addresses.'), BOOLEAN, RESTORE), ('summarize_email_suffixes', _('Summarise email suffixes'), False, _('Try to capitalize on mail sent to multiple similar addresses.'), BOOLEAN, RESTORE), ('skip_max_word_size', _('Long skip trigger length'), 12, _("Length of words that triggers 'long skips'. Longer than this\n triggers a skip."), INTEGER, RESTORE), ('x-pick_apart_urls', _('Extract clues about url structure'), False, _('(EXPERIMENTAL) Note whether url contains non-standard port or\n user/password elements.'), BOOLEAN, RESTORE), ('x-fancy_url_recognition', _('Extract URLs without http:// prefix'), False, _("(EXPERIMENTAL) Recognize 'www.python.org' or ftp.python.org as URLs\n instead of just long words."), BOOLEAN, RESTORE), ('replace_nonascii_chars', _('Replace non-ascii characters'), False, _("If true, replace high-bit characters (ord(c) >= 128) and control\n characters with question marks. This allows non-ASCII character\n strings to be identified with little training and small database\n burden. It's appropriate only if your ham is plain 7-bit ASCII, or\n nearly so, so that the mere presence of non-ASCII character strings is\n known in advance to be a strong spam indicator."), BOOLEAN, RESTORE), ('x-search_for_habeas_headers', _('Search for Habeas Headers'), False, _('(EXPERIMENTAL) If true, search for the habeas headers (see\n http://www.habeas.com). If they are present and correct, this should\n be a strong ham sign, if they are present and incorrect, this should\n be a strong spam sign.'), BOOLEAN, RESTORE), ('x-reduce_habeas_headers', _('Reduce Habeas Header Tokens to Single'), False, _("(EXPERIMENTAL) If SpamBayes is set to search for the Habeas\n headers, nine tokens are generated for messages with habeas headers.\n This should be fine, since messages with the headers should either be\n ham, or result in FN so that we can send them to habeas so they can\n be sued. However, to reduce the strength of habeas headers, we offer\n the ability to reduce the nine tokens to one. (This option has no\n effect if 'Search for Habeas Headers' is False)"), BOOLEAN, RESTORE)),
'URLRetriever': (('x-slurp_urls', _('Tokenize text content at the end of URLs'), False, _("(EXPERIMENTAL) If this option is enabled, when a message normally\n scores in the 'unsure' range, and has fewer tokens than the maximum\n looked at, and contains URLs, then the text at those URLs is obtained\n and tokenized. If those tokens result in the message moving to a\n score outside the 'unsure' range, then they are added to the\n tokens for the message. This should be particularly effective\n for messages that contain only a single URL and no other text."), BOOLEAN, RESTORE), ('x-cache_expiry_days', _('Number of days to store URLs in cache'), 7, _('(EXPERIMENTAL) This is the number of days that local cached copies\n of the text at the URLs will be stored for.'), INTEGER, RESTORE), ('x-cache_directory', _('URL Cache Directory'), 'url-cache', _("(EXPERIMENTAL) So that SpamBayes doesn't need to retrieve the same\n URL over and over again, it stores local copies of the text at the\n end of the URL. This is the directory that will be used for those\n copies."), PATH, RESTORE), ('x-only_slurp_base', _('Retrieve base url'), False, _("(EXPERIMENTAL) To try and speed things up, and to avoid following\n unique URLS, if this option is enabled, SpamBayes will convert the URL\n to as basic a form it we can. All directory information is removed\n and the domain is reduced to the two (or three for those with a\n country TLD) top-most elements. For example,\n http://www.massey.ac.nz/~tameyer/index.html?you=me\n would become\n http://massey.ac.nz\n and\n http://id.example.com\n would become http://example.com\n\n This should have two beneficial effects:\n o It's unlikely that any information could be contained in this 'base'\n url that could identify the user (unless they have a *lot* of domains).\n o Many urls (both spam and ham) will strip down into the same 'base' url.\n Since we have a limited form of caching, this means that a lot fewer\n urls will have to be retrieved.\n However, this does mean that if the 'base' url is hammy and the full is\n spammy, or vice-versa, that the slurp will give back the wrong information.\n Whether or not this is the case would have to be determined by testing.\n "), BOOLEAN, RESTORE), ('x-web_prefix', _('Prefix for tokens from web pages'), '', _('(EXPERIMENTAL) It may be that what is hammy/spammy for you in email\n isn\'t from webpages. You can then set this option (to "web:", for\n example), and effectively create an independent (sub)database for\n tokens derived from parsing web pages.'), '[\\S]+', RESTORE)),
'Categorization': (('ham_cutoff', _('Ham cutoff'), 0.20000000000000001, _('Spambayes gives each email message a spam probability between\n 0 and 1. Emails below the Ham Cutoff probability are classified\n as Ham. Larger values will result in more messages being\n classified as ham, but with less certainty that all of them\n actually are ham. This value should be between 0 and 1,\n and should be smaller than the Spam Cutoff.'), REAL, RESTORE), ('spam_cutoff', _('Spam cutoff'), 0.90000000000000002, _('Emails with a spam probability above the Spam Cutoff are\n classified as Spam - just like the Ham Cutoff but at the other\n end of the scale. Messages that fall between the two values\n are classified as Unsure.'), REAL, RESTORE)),
'TestDriver': (('nbuckets', _('Number of buckets'), 200, _('Number of buckets in histograms.'), INTEGER, RESTORE), ('show_histograms', _('Show histograms'), True, _(''), BOOLEAN, RESTORE), ('compute_best_cutoffs_from_histograms', _('Compute best cutoffs from histograms'), True, _("After the display of a ham+spam histogram pair, you can get a\n listing of all the cutoff values (coinciding with histogram bucket\n boundaries) that minimize:\n best_cutoff_fp_weight * (# false positives) +\n best_cutoff_fn_weight * (# false negatives) +\n best_cutoff_unsure_weight * (# unsure msgs)\n\n This displays two cutoffs: hamc and spamc, where\n 0.0 <= hamc <= spamc <= 1.0\n\n The idea is that if something scores < hamc, it's called ham; if\n something scores >= spamc, it's called spam; and everything else is\n called 'I am not sure' -- the middle ground.\n\n Note: You may wish to increase nbuckets, to give this scheme more cutoff\n values to analyze."), BOOLEAN, RESTORE), ('best_cutoff_fp_weight', _('Best cutoff false positive weight'), 10.0, _(''), REAL, RESTORE), ('best_cutoff_fn_weight', _('Best cutoff false negative weight'), 1.0, _(''), REAL, RESTORE), ('best_cutoff_unsure_weight', _('Best cutoff unsure weight'), 0.20000000000000001, _(''), REAL, RESTORE), ('percentiles', _('Percentiles'), (5, 25, 75, 95), _('Histogram analysis also displays percentiles. For each percentile\n p in the list, the score S such that p% of all scores are <= S is\n given. Note that percentile 50 is the median, and is displayed (along\n with the min score and max score) independent of this option.'), INTEGER, RESTORE), ('show_spam_lo', _(''), 1.0, _('Display spam when show_spam_lo <= spamprob <= show_spam_hi and\n likewise for ham. The defaults here do not show anything.'), REAL, RESTORE), ('show_spam_hi', _(''), 0.0, _('Display spam when show_spam_lo <= spamprob <= show_spam_hi and\n likewise for ham. The defaults here do not show anything.'), REAL, RESTORE), ('show_ham_lo', _(''), 1.0, _('Display spam when show_spam_lo <= spamprob <= show_spam_hi and\n likewise for ham. The defaults here do not show anything.'), REAL, RESTORE), ('show_ham_hi', _(''), 0.0, _('Display spam when show_spam_lo <= spamprob <= show_spam_hi and\n likewise for ham. The defaults here do not show anything.'), REAL, RESTORE), ('show_false_positives', _('Show false positives'), True, _(''), BOOLEAN, RESTORE), ('show_false_negatives', _('Show false negatives'), False, _(''), BOOLEAN, RESTORE), ('show_unsure', _('Show unsure'), False, _(''), BOOLEAN, RESTORE), ('show_charlimit', _('Show character limit'), 3000, _('The maximum # of characters to display for a msg displayed due to\n the show_xyz options above.'), INTEGER, RESTORE), ('save_trained_pickles', _('Save trained pickles'), False, _('If save_trained_pickles is true, Driver.train() saves a binary\n pickle of the classifier after training. The file basename is given\n by pickle_basename, the extension is .pik, and increasing integers are\n appended to pickle_basename. By default (if save_trained_pickles is\n true), the filenames are class1.pik, class2.pik, ... If a file of\n that name already exists, it is overwritten. pickle_basename is\n ignored when save_trained_pickles is false.'), BOOLEAN, RESTORE), ('pickle_basename', _('Pickle basename'), 'class', _(''), '[\\w]+', RESTORE), ('save_histogram_pickles', _('Save histogram pickles'), False, _('If save_histogram_pickles is true, Driver.train() saves a binary\n pickle of the spam and ham histogram for "all test runs". The file\n basename is given by pickle_basename, the suffix _spamhist.pik\n or _hamhist.pik is appended to the basename.'), BOOLEAN, RESTORE), ('spam_directories', _('Spam directories'), 'Data/Spam/Set%d', _('default locations for timcv and timtest - these get the set number\n interpolated.'), VARIABLE_PATH, RESTORE), ('ham_directories', _('Ham directories'), 'Data/Ham/Set%d', _('default locations for timcv and timtest - these get the set number\n interpolated.'), VARIABLE_PATH, RESTORE)),
'CV Driver': (('build_each_classifier_from_scratch', _('Build each classifier from scratch'), False, _("A cross-validation driver takes N ham+spam sets, and builds N\n classifiers, training each on N-1 sets, and the predicting against the\n set not trained on. By default, it does this in a clever way,\n learning *and* unlearning sets as it goes along, so that it never\n needs to train on N-1 sets in one gulp after the first time. Setting\n this option true forces ''one gulp from-scratch'' training every time.\n There used to be a set of combining schemes that needed this, but now\n it is just in case you are paranoid <wink>."), BOOLEAN, RESTORE),),
'Classifier': (('max_discriminators', _('Maximum number of extreme words'), 150, _('The maximum number of extreme words to look at in a message, where\n "extreme" means with spam probability farthest away from 0.5. 150\n appears to work well across all corpora tested.'), INTEGER, RESTORE), ('unknown_word_prob', _('Unknown word probability'), 0.5, _('These two control the prior assumption about word probabilities.\n unknown_word_prob is essentially the probability given to a word that\n has never been seen before. Nobody has reported an improvement via\n moving it away from 1/2, although Tim has measured a mean spamprob of\n a bit over 0.5 (0.51-0.55) in 3 well-trained classifiers.'), REAL, RESTORE), ('unknown_word_strength', _('Unknown word strength'), 0.45000000000000001, _('This adjusts how much weight to give the prior\n assumption relative to the probabilities estimated by counting. At 0,\n the counting estimates are believed 100%, even to the extent of\n assigning certainty (0 or 1) to a word that has appeared in only ham\n or only spam. This is a disaster.\n\n As unknown_word_strength tends toward infinity, all probabilities\n tend toward unknown_word_prob. All reports were that a value near 0.4\n worked best, so this does not seem to be corpus-dependent.'), REAL, RESTORE), ('minimum_prob_strength', _('Minimum probability strength'), 0.10000000000000001, _('When scoring a message, ignore all words with\n abs(word.spamprob - 0.5) < minimum_prob_strength.\n This may be a hack, but it has proved to reduce error rates in many\n tests. 0.1 appeared to work well across all corpora.'), REAL, RESTORE), ('use_chi_squared_combining', _('Use chi-squared combining'), True, _('For vectors of random, uniformly distributed probabilities,\n -2*sum(ln(p_i)) follows the chi-squared distribution with 2*n degrees\n of freedom. This is the "provably most-sensitive" test the original\n scheme was monotonic with. Getting closer to the theoretical basis\n appears to give an excellent combining method, usually very extreme in\n its judgment, yet finding a tiny (in # of msgs, spread across a huge\n range of scores) middle ground where lots of the mistakes live. This\n is the best method so far. One systematic benefit is is immunity to\n "cancellation disease". One systematic drawback is sensitivity to\n *any* deviation from a uniform distribution, regardless of whether\n actually evidence of ham or spam. Rob Hooft alleviated that by\n combining the final S and H measures via (S-H+1)/2 instead of via\n S/(S+H)). In practice, it appears that setting ham_cutoff=0.05, and\n spam_cutoff=0.95, does well across test sets; while these cutoffs are\n rarely optimal, they get close to optimal. With more training data,\n Tim has had good luck with ham_cutoff=0.30 and spam_cutoff=0.80 across\n three test data sets (original c.l.p data, his own email, and newer\n general python.org traffic).'), BOOLEAN, RESTORE), ('use_bigrams', _('Use mixed uni/bi-grams scheme'), False, _("Generate both unigrams (words) and bigrams (pairs of\n words). However, extending an idea originally from Gary Robinson, the\n message is 'tiled' into non-overlapping unigrams and bigrams,\n approximating the strongest outcome over all possible tilings.\n\n Note that to really test this option you need to retrain with it on,\n so that your database includes the bigrams - if you subsequently turn\n it off, these tokens will have no effect. This option will at least\n double your database size given the same training data, and will\n probably at least triple it.\n\n You may also wish to increase the max_discriminators (maximum number\n of extreme words) option if you enable this option, perhaps doubling or\n quadrupling it. It's not yet clear. Bigrams create many more hapaxes,\n and that seems to increase the brittleness of minimalist training\n regimes; increasing max_discriminators may help to soften that effect.\n OTOH, max_discriminators defaults to 150 in part because that makes it\n easy to prove that the chi-squared math is immune from numeric\n problems. Increase it too much, and insane results will eventually\n result (including fatal floating-point exceptions on some boxes).\n\n This option is experimental, and may be removed in a future release.\n We would appreciate feedback about it if you use it - email\n spambayes@python.org with your comments and results.\n "), BOOLEAN, RESTORE)),
'Hammie': (('train_on_filter', _('Train when filtering'), False, _("Train when filtering? After filtering a message, hammie can then\n train itself on the judgement (ham or spam). This can speed things up\n with a procmail-based solution. If you do enable this, please make\n sure to retrain any mistakes. Otherwise, your word database will\n slowly become useless. Note that this option is only used by\n sb_filter, and will have no effect on sb_server's POP3 proxy, or\n the IMAP filter."), BOOLEAN, RESTORE),),
'Storage': (('persistent_use_database', _('Database backend'), DB_TYPE[0], _('SpamBayes can use either a ZODB or dbm database (quick to score\n one message) or a pickle (quick to train on huge amounts of messages).\n There is also (currently experimental) the ability to use a mySQL or\n PostgrepSQL database.'), ('zeo', 'zodb', 'cdb', 'mysql', 'pgsql', 'dbm', 'pickle'), RESTORE), ('persistent_storage_file', _('Storage file name'), DB_TYPE[1], _("Spambayes builds a database of information that it gathers\n from incoming emails and from you, the user, to get better and\n better at classifying your email. This option specifies the\n name of the database file. If you don't give a full pathname,\n the name will be taken to be relative to the location of the\n most recent configuration file loaded."), FILE_WITH_PATH, DO_NOT_RESTORE), ('messageinfo_storage_file', _('Message information file name'), DB_TYPE[2], _("Spambayes builds a database of information about messages\n that it has already seen and trained or classified. This\n database is used to ensure that these messages are not retrained\n or reclassified (unless specifically requested to). This option\n specifies the name of the database file. If you don't give a\n full pathname, the name will be taken to be relative to the location\n of the most recent configuration file loaded."), FILE_WITH_PATH, DO_NOT_RESTORE), ('cache_use_gzip', _('Use gzip'), False, _('Use gzip to compress the cache.'), BOOLEAN, RESTORE), ('cache_expiry_days', _('Days before cached messages expire'), 7, _('Messages will be expired from the cache after this many days.\n After this time, you will no longer be able to train on these messages\n (note this does not affect the copy of the message that you have in\n your mail client).'), INTEGER, RESTORE), ('spam_cache', _('Spam cache directory'), 'pop3proxy-spam-cache', _('Directory that SpamBayes should cache spam in. If this does\n not exist, it will be created.'), PATH, DO_NOT_RESTORE), ('ham_cache', _('Ham cache directory'), 'pop3proxy-ham-cache', _('Directory that SpamBayes should cache ham in. If this does\n not exist, it will be created.'), PATH, DO_NOT_RESTORE), ('unknown_cache', _('Unknown cache directory'), 'pop3proxy-unknown-cache', _('Directory that SpamBayes should cache unclassified messages in.\n If this does not exist, it will be created.'), PATH, DO_NOT_RESTORE), ('cache_messages', _('Cache messages'), True, _("You can disable the pop3proxy caching of messages. This\n will make the proxy a bit faster, and make it use less space\n on your hard drive. The proxy uses its cache for reviewing\n and training of messages, so if you disable caching you won't\n be able to do further training unless you re-enable it.\n Thus, you should only turn caching off when you are satisfied\n with the filtering that Spambayes is doing for you."), BOOLEAN, RESTORE), ('no_cache_bulk_ham', _('Suppress caching of bulk ham'), False, _("Where message caching is enabled, this option suppresses caching\n of messages which are classified as ham and marked as\n 'Precedence: bulk' or 'Precedence: list'. If you subscribe to a\n high-volume mailing list then your 'Review messages' page can be\n overwhelmed with list messages, making training a pain. Once you've\n trained Spambayes on enough list traffic, you can use this option\n to prevent that traffic showing up in 'Review messages'."), BOOLEAN, RESTORE), ('no_cache_large_messages', _('Maximum size of cached messages'), 0, _('Where message caching is enabled, this option suppresses caching\n of messages which are larger than this value (measured in bytes).\n If you receive a lot of messages that include large attachments\n (and are correctly classified), you may not wish to cache these.\n If you set this to zero (0), then this option will have no effect.'), INTEGER, RESTORE)),
'Headers': (('classification_header_name', _('Classification header name'), 'X-Spambayes-Classification', _('Spambayes classifies each message by inserting a new header into\n the message. This header can then be used by your email client\n (provided your client supports filtering) to move spam into a\n separate folder (recommended), delete it (not recommended), etc.\n This option specifies the name of the header that Spambayes inserts.\n The default value should work just fine, but you may change it to\n anything that you wish.'), HEADER_NAME, RESTORE), ('header_spam_string', _('Spam disposition name'), _('spam'), _('The header that Spambayes inserts into each email has a name,\n (Classification eader name, above), and a value. If the classifier\n determines that this email is probably spam, it places a header named\n as above with a value as specified by this string. The default\n value should work just fine, but you may change it to anything\n that you wish.'), HEADER_VALUE, RESTORE), ('header_ham_string', _('Ham disposition name'), _('ham'), _('As for Spam Designation, but for emails classified as Ham.'), HEADER_VALUE, RESTORE), ('header_unsure_string', _('Unsure disposition name'), _('unsure'), _("As for Spam/Ham Designation, but for emails which the\n classifer wasn't sure about (ie. the spam probability fell between\n the Ham and Spam Cutoffs). Emails that have this classification\n should always be the subject of training."), HEADER_VALUE, RESTORE), ('header_score_digits', _('Accuracy of reported score'), 2, _('Accuracy of the score in the header in decimal digits.'), INTEGER, RESTORE), ('header_score_logarithm', _('Augment score with logarithm'), False, _('Set this option to augment scores of 1.00 or 0.00 by a\n logarithmic "one-ness" or "zero-ness" score (basically it shows the\n "number of zeros" or "number of nines" next to the score value).'), BOOLEAN, RESTORE), ('include_score', _('Add probability (score) header'), False, _("You can have Spambayes insert a header with the calculated spam\n probability into each mail. If you can view headers with your\n mailer, then you can see this information, which can be interesting\n and even instructive if you're a serious SpamBayes junkie."), BOOLEAN, RESTORE), ('score_header_name', _('Probability (score) header name'), 'X-Spambayes-Spam-Probability', _(''), HEADER_NAME, RESTORE), ('include_thermostat', _('Add level header'), False, _("You can have spambayes insert a header with the calculated spam\n probability, expressed as a number of '*'s, into each mail (the more\n '*'s, the higher the probability it is spam). If your mailer\n supports it, you can use this information to fine tune your\n classification of ham/spam, ignoring the classification given."), BOOLEAN, RESTORE), ('thermostat_header_name', _('Level header name'), 'X-Spambayes-Level', _(''), HEADER_NAME, RESTORE), ('include_evidence', _('Add evidence header'), False, _('You can have spambayes insert a header into mail, with the\n evidence that it used to classify that message (a collection of\n words with ham and spam probabilities). If you can view headers\n with your mailer, then this may give you some insight as to why\n a particular message was scored in a particular way.'), BOOLEAN, RESTORE), ('evidence_header_name', _('Evidence header name'), 'X-Spambayes-Evidence', _(''), HEADER_NAME, RESTORE), ('mailid_header_name', _('Spambayes id header name'), 'X-Spambayes-MailId', _(''), HEADER_NAME, RESTORE), ('include_trained', _('Add trained header'), True, _("sb_mboxtrain.py and sb_filter.py can add a header that details\n how a message was trained, which lets you keep track of it, and\n appropriately re-train messages. However, if you would rather\n mboxtrain/sb_filter didn't rewrite the message files, you can disable\n this option."), BOOLEAN, RESTORE), ('trained_header_name', _('Trained header name'), 'X-Spambayes-Trained', _('When training on a message, the name of the header to add with how\n it was trained'), HEADER_NAME, RESTORE), ('clue_mailheader_cutoff', _('Debug header cutoff'), 0.5, _('The range of clues that are added to the "debug" header in the\n E-mail. All clues that have their probability smaller than this number,\n or larger than one minus this number are added to the header such that\n you can see why spambayes thinks this is ham/spam or why it is unsure.\n The default is to show all clues, but you can reduce that by setting\n showclue to a lower value, such as 0.1'), REAL, RESTORE), ('add_unique_id', _('Add unique spambayes id'), True, _("If you wish to be able to find a specific message (via the 'find'\n box on the home page), or use the SMTP proxy to train using cached\n messages, you will need to know the unique id of each message. This\n option adds this information to a header added to each message."), BOOLEAN, RESTORE), ('notate_to', _('Notate to'), (), _('Some email clients (Outlook Express, for example) can only set up\n filtering rules on a limited set of headers. These clients cannot\n test for the existence/value of an arbitrary header and filter mail\n based on that information. To accommodate these kind of mail clients,\n you can add "spam", "ham", or "unsure" to the recipient list. A\n filter rule can then use this to see if one of these words (followed\n by a comma) is in the recipient list, and route the mail to an\n appropriate folder, or take whatever other action is supported and\n appropriate for the mail classification.\n\n As it interferes with replying, you may only wish to do this for\n spam messages; simply tick the boxes of the classifications take\n should be identified in this fashion.'), ((), _('ham'), _('spam'), _('unsure')), RESTORE), ('notate_subject', _('Classify in subject: header'), (), _("This option will add the same information as 'Notate To',\n but to the start of the mail subject line."), ((), _('ham'), _('spam'), _('unsure')), RESTORE)),
'pop3proxy': (('remote_servers', _('Remote Servers'), (), _('The SpamBayes POP3 proxy intercepts incoming email and classifies\n it before sending it on to your email client. You need to specify\n which POP3 server(s) you wish it to intercept - a POP3 server\n address typically looks like "pop3.myisp.net". If you use more than\n one server, simply separate their names with commas. You can get\n these server names from your existing email configuration, or from\n your ISP or system administrator. If you are using Web-based email,\n you can\'t use the SpamBayes POP3 proxy (sorry!). In your email\n client\'s configuration, where you would normally put your POP3 server\n address, you should now put the address of the machine running\n SpamBayes.'), SERVER, DO_NOT_RESTORE), ('listen_ports', _('SpamBayes Ports'), (), _("Each POP3 server that is being monitored must be assigned to a\n 'port' in the SpamBayes POP3 proxy. This port must be different for\n each monitored server, and there must be a port for\n each monitored server. Again, you need to configure your email\n client to use this port. If there are multiple servers, you must\n specify the same number of ports as servers, separated by commas.\n If you don't know what to use here, and you only have one server,\n try 110, or if that doesn't work, try 8110."), SERVER, DO_NOT_RESTORE), ('allow_remote_connections', _('Allowed remote POP3 connections'), 'localhost', _("Enter a list of trusted IPs, separated by commas. Remote POP\n connections from any of them will be allowed. You can trust any\n IP using a single '*' as field value. You can also trust ranges of\n IPs using the '*' character as a wildcard (for instance 192.168.0.*).\n The localhost IP will always be trusted. Type 'localhost' in the\n field to trust this only address."), IP_LIST, RESTORE), ('retrieval_timeout', _('Retrieval timeout'), 30, _('When proxying messages, time out after this length of time if\n all the headers have been received. The rest of the mesasge will\n proxy straight through. Some clients have a short timeout period,\n and will give up on waiting for the message if this is too long.\n Note that the shorter this is, the less of long messages will be\n used for classifications (i.e. results may be effected).'), REAL, RESTORE), ('use_ssl', 'Connect via a secure socket layer', False, 'Use SSL to connect to the server. This allows spambayes to connect\n without sending data in plain text.\n\n Note that this does not check the server certificate at this point in\n time.', (False, True, 'automatic'), DO_NOT_RESTORE)),
'smtpproxy': (('remote_servers', _('Remote Servers'), (), _('Use of the SMTP proxy is optional - if you would rather just train\n via the web interface, or the pop3dnd or mboxtrain scripts, then you\n can safely leave this option blank. The Spambayes SMTP proxy\n intercepts outgoing email - if you forward mail to one of the\n addresses below, it is examined for an id and the message\n corresponding to that id is trained as ham/spam. All other mail is\n sent along to your outgoing mail server. You need to specify which\n SMTP server(s) you wish it to intercept - a SMTP server address\n typically looks like "smtp.myisp.net". If you use more than one\n server, simply separate their names with commas. You can get these\n server names from your existing email configuration, or from your ISP\n or system administrator. If you are using Web-based email, you can\'t\n use the Spambayes SMTP proxy (sorry!). In your email client\'s\n configuration, where you would normally put your SMTP server address,\n you should now put the address of the machine running SpamBayes.'), SERVER, DO_NOT_RESTORE), ('listen_ports', _('SpamBayes Ports'), (), _("Each SMTP server that is being monitored must be assigned to a\n 'port' in the Spambayes SMTP proxy. This port must be different for\n each monitored server, and there must be a port for\n each monitored server. Again, you need to configure your email\n client to use this port. If there are multiple servers, you must\n specify the same number of ports as servers, separated by commas."), SERVER, DO_NOT_RESTORE), ('allow_remote_connections', _('Allowed remote SMTP connections'), 'localhost', _("Enter a list of trusted IPs, separated by commas. Remote SMTP\n connections from any of them will be allowed. You can trust any\n IP using a single '*' as field value. You can also trust ranges of\n IPs using the '*' character as a wildcard (for instance 192.168.0.*).\n The localhost IP will always be trusted. Type 'localhost' in the\n field to trust this only address. Note that you can unwittingly\n turn a SMTP server into an open proxy if you open this up, as\n connections to the server will appear to be from your machine, even\n if they are from a remote machine *through* your machine, to the\n server. We do not recommend opening this up fully (i.e. using '*').\n "), IP_LIST, RESTORE), ('ham_address', _('Train as ham address'), 'spambayes_ham@localhost', _('When a message is received that you wish to train on (for example,\n one that was incorrectly classified), you need to forward or bounce\n it to one of two special addresses so that the SMTP proxy can identify\n it. If you wish to train it as ham, forward or bounce it to this\n address. You will want to use an address that is not\n a valid email address, like ham@nowhere.nothing.'), EMAIL_ADDRESS, RESTORE), ('spam_address', _('Train as spam address'), 'spambayes_spam@localhost', _('As with Ham Address above, but the address that you need to forward\n or bounce mail that you wish to train as spam. You will want to use\n an address that is not a valid email address, like\n spam@nowhere.nothing.'), EMAIL_ADDRESS, RESTORE), ('use_cached_message', _('Lookup message in cache'), False, _("If this option is set, then the smtpproxy will attempt to\n look up the messages sent to it (for training) in the POP3 proxy cache\n or IMAP filter folders, and use that message as the training data.\n This avoids any problems where your mail client might change the\n message when forwarding, contaminating your training data. If you can\n be sure that this won't occur, then the id-lookup can be avoided.\n\n Note that Outlook Express users cannot use the lookup option (because\n of the way messages are forwarded), and so if they wish to use the\n SMTP proxy they must enable this option (but as messages are altered,\n may not get the best results, and this is not recommended)."), BOOLEAN, RESTORE)),
'imap4proxy': (('remote_servers', _('Remote Servers'), (), _('The SpamBayes IMAP4 proxy intercepts incoming email and classifies\n it before sending it on to your email client. You need to specify\n which IMAP4 server(s) you wish it to intercept - a IMAP4 server\n address typically looks like "mail.myisp.net". If you use more than\n one server, simply separate their names with commas. You can get\n these server names from your existing email configuration, or from\n your ISP or system administrator. If you are using Web-based email,\n you can\'t use the SpamBayes IMAP4 proxy (sorry!). In your email\n client\'s configuration, where you would normally put your IMAP4 server\n address, you should now put the address of the machine running\n SpamBayes.'), SERVER, DO_NOT_RESTORE), ('listen_ports', _('SpamBayes Ports'), (), _("Each IMAP4 server that is being monitored must be assigned to a\n 'port' in the SpamBayes IMAP4 proxy. This port must be different for\n each monitored server, and there must be a port for each monitored\n server. Again, you need to configure your email client to use this\n port. If there are multiple servers, you must specify the same number\n of ports as servers, separated by commas. If you don't know what to\n use here, and you only have one server, try 143, or if that doesn't\n work, try 8143."), SERVER, DO_NOT_RESTORE), ('allow_remote_connections', _('Allowed remote IMAP4 connections'), 'localhost', _("Enter a list of trusted IPs, separated by commas. Remote IMAP\n connections from any of them will be allowed. You can trust any\n IP using a single '*' as field value. You can also trust ranges of\n IPs using the '*' character as a wildcard (for instance 192.168.0.*).\n The localhost IP will always be trusted. Type 'localhost' in the\n field to trust this only address."), IP_LIST, RESTORE), ('use_ssl', 'Connect via a secure socket layer', False, 'Use SSL to connect to the server. This allows spambayes to connect\n without sending data in plain text.\n\n Note that this does not check the server certificate at this point in\n time.', (False, True, 'automatic'), DO_NOT_RESTORE)),
'html_ui': (('port', _('Port'), 8880, _(''), PORT, RESTORE), ('launch_browser', _('Launch browser'), False, _('If this option is set, then whenever sb_server or sb_imapfilter is\n started the default web browser will be opened to the main web\n interface page. Use of the -b switch when starting from the command\n line overrides this option.'), BOOLEAN, RESTORE), ('allow_remote_connections', _('Allowed remote UI connections'), 'localhost', _("Enter a list of trusted IPs, separated by commas. Remote\n connections from any of them will be allowed. You can trust any\n IP using a single '*' as field value. You can also trust ranges of\n IPs using the '*' character as a wildcard (for instance 192.168.0.*).\n The localhost IP will always be trusted. Type 'localhost' in the\n field to trust this only address."), IP_LIST, RESTORE), ('display_headers', _('Headers to display in message review'), ('Subject', 'From'), _('When reviewing messages via the web user interface, you are\n presented with various information about the message. By default, you\n are shown the subject and who the message is from. You can add other\n message headers to display, however, such as the address the message\n is to, or the date that the message was sent.'), HEADER_NAME, RESTORE), ('display_received_time', _('Display date received in message review'), False, _('When reviewing messages via the web user interface, you are\n presented with various information about the message. If you set\n this option, you will be shown the date that the message was received.\n '), BOOLEAN, RESTORE), ('display_score', _('Display score in message review'), False, _('When reviewing messages via the web user interface, you are\n presented with various information about the message. If you\n set this option, this information will include the score that\n the message received when it was classified. You might wish to\n see this purely out of curiousity, or you might wish to only\n train on messages that score towards the boundaries of the\n classification areas. Note that in order to use this option,\n you must also enable the option to include the score in the\n message headers.'), BOOLEAN, RESTORE), ('display_adv_find', _('Display the advanced find query'), False, _("Present advanced options in the 'Word Query' box on the front page,\n including wildcard and regular expression searching."), BOOLEAN, RESTORE), ('default_ham_action', _('Default training for ham'), _('discard'), _('When presented with the review list in the web interface,\n which button would you like checked by default when the message\n is classified as ham?'), (_('ham'), _('spam'), _('discard'), _('defer')), RESTORE), ('default_spam_action', _('Default training for spam'), _('discard'), _('When presented with the review list in the web interface,\n which button would you like checked by default when the message\n is classified as spam?'), (_('ham'), _('spam'), _('discard'), _('defer')), RESTORE), ('default_unsure_action', _('Default training for unsure'), _('defer'), _('When presented with the review list in the web interface,\n which button would you like checked by default when the message\n is classified as unsure?'), (_('ham'), _('spam'), _('discard'), _('defer')), RESTORE), ('ham_discard_level', _('Ham Discard Level'), 0.0, _("Hams scoring less than this percentage will default to being\n discarded in the training interface (they won't be trained). You'll\n need to turn off the 'Train when filtering' option, above, for this\n to have any effect"), REAL, RESTORE), ('spam_discard_level', _('Spam Discard Level'), 100.0, _("Spams scoring more than this percentage will default to being\n discarded in the training interface (they won't be trained). You'll\n need to turn off the 'Train when filtering' option, above, for this\n to have any effect"), REAL, RESTORE), ('http_authentication', _('HTTP Authentication'), 'None', _('This option lets you choose the security level of the web interface.\n When selecting Basic or Digest, the user will be prompted a login and a\n password to access the web interface. The Basic option is faster, but\n transmits the password in clear on the network. The Digest option\n encrypts the password before transmission.'), ('None', 'Basic', 'Digest'), RESTORE), ('http_user_name', _('User name'), 'admin', _('If you activated the HTTP authentication option, you can modify the\n authorized user name here.'), '[\\w]+', RESTORE), ('http_password', _('Password'), 'admin', _('If you activated the HTTP authentication option, you can modify the\n authorized user password here.'), '[\\w]+', RESTORE), ('rows_per_section', _('Rows per section'), 10000, _('Number of rows to display per ham/spam/unsure section.'), INTEGER, RESTORE)),
'imap': (('server', _('Server'), (), _('These are the names and ports of the imap servers that store your\n mail, and which the imap filter will connect to - for example:\n mail.example.com or imap.example.com:143. The default IMAP port is\n 143 (or 993 if using SSL); if you connect via one of those ports, you\n can leave this blank. If you use more than one server, use a comma\n delimited list of the server:port values.'), SERVER, DO_NOT_RESTORE), ('username', _('Username'), (), _('This is the id that you use to log into your imap server. If your\n address is funkyguy@example.com, then your username is probably\n funkyguy.'), IMAP_ASTRING, DO_NOT_RESTORE), ('password', _('Password'), (), _("That is that password that you use to log into your imap server.\n This will be stored in plain text in your configuration file, and if\n you have set the web user interface to allow remote connections, then\n it will be available for the whole world to see in plain text. If\n I've just freaked you out, don't panic <wink>. You can leave this\n blank and use the -p command line option to imapfilter.py and you will\n be prompted for your password."), IMAP_ASTRING, DO_NOT_RESTORE), ('expunge', _('Purge//Expunge'), False, _('Permanently remove *all* messages flagged with //Deleted on logout.\n If you do not know what this means, then please leave this as\n False.'), BOOLEAN, RESTORE), ('use_ssl', _('Connect via a secure socket layer'), False, _('Use SSL to connect to the server. This allows spambayes to connect\n without sending the password in plain text.\n\n Note that this does not check the server certificate at this point in\n time.'), BOOLEAN, DO_NOT_RESTORE), ('filter_folders', _('Folders to filter'), ('INBOX',), _('Comma delimited list of folders to be filtered'), IMAP_FOLDER, DO_NOT_RESTORE), ('unsure_folder', _('Folder for unsure messages'), '', _(''), IMAP_FOLDER, DO_NOT_RESTORE), ('spam_folder', _('Folder for suspected spam'), '', _(''), IMAP_FOLDER, DO_NOT_RESTORE), ('ham_folder', _('Folder for ham messages'), '', _('If you leave this option blank, messages classified as ham will not\n be moved. However, if you wish to have ham messages moved, you can\n select a folder here.'), IMAP_FOLDER, DO_NOT_RESTORE), ('ham_train_folders', _('Folders with mail to be trained as ham'), (), _('Comma delimited list of folders that will be examined for messages\n to train as ham.'), IMAP_FOLDER, DO_NOT_RESTORE), ('spam_train_folders', _('Folders with mail to be trained as spam'), (), _('Comma delimited list of folders that will be examined for messages\n to train as spam.'), IMAP_FOLDER, DO_NOT_RESTORE), ('move_trained_spam_to_folder', _('Folder to move trained spam to'), '', _('When training, all messages in the spam training folder(s) (above)\n are examined - if they are new, they are used to train, if not, they\n are ignored. This examination does take time, however, so if speed\n is an issue for you, you may wish to move messages out of this folder\n once they have been trained (either to delete them or to a storage\n folder). If a folder name is specified here, this will happen\n automatically. Note that the filter is not yet clever enough to\n move the mail to different folders depending on which folder it\n was originally in - *all* messages will be moved to the same\n folder.'), IMAP_FOLDER, DO_NOT_RESTORE), ('move_trained_ham_to_folder', _('Folder to move trained ham to'), '', _('When training, all messages in the ham training folder(s) (above)\n are examined - if they are new, they are used to train, if not, they\n are ignored. This examination does take time, however, so if speed\n is an issue for you, you may wish to move messages out of this folder\n once they have been trained (either to delete them or to a storage\n folder). If a folder name is specified here, this will happen\n automatically. Note that the filter is not yet clever enough to\n move the mail to different folders depending on which folder it\n was originally in - *all* messages will be moved to the same\n folder.'), IMAP_FOLDER, DO_NOT_RESTORE)),
'imapserver': (('username', _('Username'), '', _('The username to use when logging into the SpamBayes IMAP server.'), IMAP_ASTRING, DO_NOT_RESTORE), ('password', _('Password'), '', _('The password to use when logging into the SpamBayes IMAP server.'), IMAP_ASTRING, DO_NOT_RESTORE), ('port', _('IMAP Listen Port'), 143, _('The port to serve the SpamBayes IMAP server on.'), PORT, RESTORE)),
'globals': (('verbose', _('Verbose'), False, _(''), BOOLEAN, RESTORE), ('dbm_type', _('Database storage type'), 'best', _('What DBM storage type should we use? Must be best, db3hash,\n dbhash or gdbm. Windows folk should steer clear of dbhash. Default\n is "best", which will pick the best DBM type available on your\n platform.'), ('best', 'db3hash', 'dbhash', 'gdbm'), RESTORE), ('proxy_username', _('HTTP Proxy Username'), '', _('The username to give to the HTTP proxy when required. If a\n username is not necessary, simply leave blank.'), '[\\w]+', DO_NOT_RESTORE), ('proxy_password', _('HTTP Proxy Password'), '', _("The password to give to the HTTP proxy when required. This is\n stored in clear text in your configuration file, so if that bothers\n you then don't do this. You'll need to use a proxy that doesn't need\n authentication, or do without any SpamBayes HTTP activity."), '[\\w]+', DO_NOT_RESTORE), ('proxy_server', _('HTTP Proxy Server'), '', _('If a spambayes application needs to use HTTP, it will try to do so\n through this proxy server. The port defaults to 8080, or can be\n entered with the server:port form.'), SERVER, DO_NOT_RESTORE), ('language', _('User Interface Language'), ('en_US',), _('If possible, the user interface should use a language from this\n list (in order of preference).'), '\\w\\w(?:_\\w\\w)?', RESTORE)) }
optionsPathname = None
options = None
def load_options():
global options, optionsPathname, optionsPathname, optionsPathname, optionsPathname, optionsPathname
if sys.platform.startswith('win') and not os.path.isfile(optionsPathname):
try:
shell = shell
shellcon = shellcon
import win32com.shell
except ImportError:
print >>sys.stderr, "NOTE: We can not locate an INI file for SpamBayes, and the Python for Windows extensions are not installed, meaning we can't locate your 'user' directory. An empty configuration file at '%s' will be used." % optionsPathname.encode('mbcs')